From e27b3b441146a822d9423cbe6161d73ed65cf829 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 21 Aug 2025 16:35:51 -0400 Subject: [PATCH] update test suite for change fd89e611b2310b46368c91bcd79999b0ba8462a3 changed the exit code of git-annex sync which broke the test suite I'm actually a bit surprised that this test's export works after the sync fails. huh --- Test.hs | 10 ++++++++-- Test/Framework.hs | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Test.hs b/Test.hs index 2fb6d6a03b..bf09dd7d55 100644 --- a/Test.hs +++ b/Test.hs @@ -2085,7 +2085,12 @@ test_export_import = intmpclonerepo $ do removeWhenExistsWith removeFile (literalOsPath "import") writecontent "import" (content "newimport3") git_annex "add" ["import"] "add of import" - commitchanges + ifM onAdjustedBranch + -- On an adjusted branch, sync fails when there is a merge + -- commit in history. + ( git_annex_shouldfail "sync" commitchangesparams "sync" + , commitchanges + ) git_annex "export" [origbranch, "--to", "foo"] "export after import conflict" dircontains "import" (content "newimport3") where @@ -2097,7 +2102,8 @@ test_export_import = intmpclonerepo $ do -- When on an adjusted branch, this updates the master branch -- to match it, which is necessary since the master branch is going -- to be exported. - commitchanges = git_annex "sync" ["--no-pull", "--no-push", "--no-content"] "sync" + commitchanges = git_annex "sync" commitchangesparams "sync" + commitchangesparams = ["--no-pull", "--no-push", "--no-content"] test_export_import_subdir :: Assertion test_export_import_subdir = intmpclonerepo $ do diff --git a/Test/Framework.hs b/Test/Framework.hs index a0dd710522..09ffe0a26d 100644 --- a/Test/Framework.hs +++ b/Test/Framework.hs @@ -535,6 +535,9 @@ testMode opts v = TestMode hasUnlockedFiles :: TestMode -> Bool hasUnlockedFiles m = unlockedFiles m || adjustedUnlockedBranch m +onAdjustedBranch :: IO Bool +onAdjustedBranch = adjustedUnlockedBranch <$> getTestMode + withTestMode :: TestMode -> TestTree -> TestTree withTestMode testmode = withResource prepare release . const where -- 2.30.2